package com.me.model.viewmodel;

import com.me.annotation.FieldAttr;
import com.me.enums.FieldType;
import com.me.model.Order;
import com.me.model.User;

public class PayViewModel {
	@FieldAttr(value = "用户ID",type= FieldType.hidden)
	public String userid;
	@FieldAttr(value = "收货人",required = true)
	public String name;
	@FieldAttr(value = "收货电话",required = true)
	public String phone;
	@FieldAttr(value = "收货地址",required = true)
	public String address;
	public int paytype;

	public float price;
	public String id;

	public PayViewModel() {
	}

	public PayViewModel(User u, Order o) {
		userid = u.getId();
		name = u.getName();
		phone = u.getPhone();
		address = u.getAddress();
		paytype = -1;

		id = o.getId();
		price = o.getTotal();

	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getPaytype() {
		return paytype;
	}

	public void setPaytype(String paytype) {
		this.paytype = Integer.parseInt(paytype);
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = Float.parseFloat(price);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}


}
